package object;

import java.util.Arrays;

public class Exercise {
    public static void main(String[] args) {
        /*
        String email="yanzy@qq. com";
        String regex="[a-zA-Z1-9]+@[a-zA-Z1-9]+(\\.[a-zA-Z]+)+";
        boolean match=email.matches(regex);
        if(match){
            System.out.println("是正确的的邮箱格式");
        }else {
            System.out.println("不是正确的邮箱格式");
        }


        String email1="2194@qq.com";
        String regex1="[a-zA-Z1-9]+@[a-zA-Z1-9]+(\\.[a-zA-Z]+)+";
        boolean match1=email.matches(regex);
        if (match1){
            System.out.println("是正确的邮箱格式");
        }else {
            System.out.println("不是正确的邮箱格式");
        }



        String line="abc123def456hgi";
        line =line.replaceAll("[1-9]+","#NUMBER#");
        System.out.println(line);






        String ling="213abc546efg768";
        ling=ling.replaceAll("[1-9]+","NUMBER");
        System.out.println(ling);


        String uio="123abc456qwq567";
        String[]data=uio.split("[1-9]+");
        System.out.println(Arrays.toString(data));

        uio="123456.6.6";
        data=uio.split("\\.");
        System.out.println(Arrays.toString(data));

        String ufo="abc246qwq357";
        String[]dada=ufo.split("[a-z]+");
        System.out.println(Arrays.toString(dada));
         */
        /*
        Ex001 q1=new Ex001(100,200);
        Ex001 q2=new Ex001(100,200);
        System.out.println(q1==q2);
        System.out.println(q1.equals(q2));

        String g1=new String("hi");
        String g2=new String("hi");
        System.out.println(g1.equals(g2));

        StringBuilder builder1=new StringBuilder("hi");
        StringBuilder builder2=new StringBuilder("hi");
        System.out.println(builder1.equals(builder2));

        System.out.println(g1.equals(builder1));
         */

        Point p1=new Point(7,8);
        Point p2=new Point(6,8);
        System.out.println(p1==p2);
        System.out.println(p1.equals(p2));

        String s1=new String("hellow");
        String s2=new String("hellow");
        System.out.println(s1.equals(s2));

        StringBuilder builder1=new StringBuilder("hellow");
        StringBuilder builder2=new StringBuilder("hellow");
        System.out.println(s1.equals(builder2));


    }
}
